<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tr09" uri="http://www.51i-star.com/mypagetagscevaluate" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分页浏览订单</title>
<style type="text/css">
	body{
		background:#dae4fe;
	}
.t{
		border-collapse: collapse;
		border: none;
		width: 700px;
		font-size:14px;
		margin-top:20px;
	}
	.t td{
		text-align: center;
	}
	.border_bottom_empty{
		background:#CCC;
	}
	.c{
		background:#CCC;
	}
	tr:hover{
		cursor:pointer;
	}
	h2,table,.pager{
		margin-left:20px;
	}
	.one1{
		font-size:14px;
		font-weight:bold;
		margin:5px;
	}
</style>
<link rel=stylesheet type=text/css href="css/input.css">
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<script>
		$(function(){
			$("tr:even").css("background","#ccffcc");
			$("tr:odd").css("background","#ccffff");
			$("table tr").mouseenter(function(){
				$(this).css("background","#CCC");
			}).mouseleave(function(){
				$("tr:even").css("background","#ccffcc");
				$("tr:odd").css("background","#ccffff");
			});
			$(function(){
				$(".def").click(function(){
					var oid = $(this).attr("oid");
					$.get("updateorders",{oid:oid},function(v){
						alert(v);
					});
				});
			});
		});
</script>
</head>
<body>
	<div class="one1">
		订单管理->分页浏览订单信息
		<hr>
	</div>
	<h2>订单信息</h2>
	<form action="selectorderzhongzhuan?curpage=1&pagesize=10" method="post">
		<select name="cid">
			<option value="0">按商品名</option>
			<c:forEach items="${comlist}" var="com">
				<c:if test="${cid eq com.cId}">
					<option selected="selected" value="${com.cId}">${com.cName}</option>
				</c:if>
				<c:if test="${cid ne com.cId}">
					<option value="${com.cId}">${com.cName}</option>
				</c:if>
			</c:forEach>
		</select>
		<select name="uid">
			<option value="0">按用户名</option>
			<c:forEach items="${userlist}" var="u">
			<c:if test="${uid eq u.uId}">
				<option selected="selected" value="${u.uId}">${u.uName}</option>
			</c:if>
			<c:if test="${uid ne u.uId}">
				<option value="${u.uId}">${u.uName}</option>
			</c:if>	
			</c:forEach>
		</select>
		<input type="submit" value="查   询">
	</form>
	<table id="t" border="1" class="t">
		<tr class ="border_bottom_empty">
			<th>订单号</th>
			<th>用户名</th>
			<th>商品名</th>
			<th>下单时间</th>
			<th>订单状态</th>
			<th>发货时间</th>
			<th>数量</th>
			<th>单价</th>
			<th>总金额</th>
			<th>操作</th>
		</tr>
		<tbody>
		<c:forEach items="${list}" var="order">
			<tr>
				<td width="10%">${order.oId}</td>
				<td width="10%">${order.uName}</td>
				<td width="10%">${order.cName}</td>
				<td width="15%"><fmt:formatDate value="${order.oDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td width="10%">${order.oState}</td>
				<td width="15%"><fmt:formatDate value="${order.oCdate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td width="5%">${order.odNum}</td>
				<td width="5%">${order.odPrice}</td>
				<td width="5%">${order.oPrice}</td>
				<td width="15%">
					<a class="def" oid="${order.oId}" href="javascript:void(0)"><img title="发货" src="images/tubiao3/发货.png"></a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pager">
		<tr09:pager url="selectorderzhongzhuan" uid="${uid }" pagesize="10" total="${total }" curpage="${param.curpage }" cid="${cid }"/>
	</div>
</body>
</html>